import request from '/src/utils/request.ts';

export const login = (account: String, password: String) => request({
        url: '/login/mobile/password',
        method: 'POST',
        data: {
            phone: account,
            password: password
        }
    });

export const getMenu= (userid: number) :Array<MenuItem>=> {
    // 最多支持3级菜单
    return [{
        path: '/user',
        name: '用户管理',
        icon: 'User',
        module: 'user/user',
        url: '',
        children: []
    },{
        path: '/system',
        name: '系统管理',
        icon: 'Operation',
        module: '',
        url: '',
        children: [{
            path: '/user2',
            name: '用户管理',
            icon: 'User',
            module: 'user/user',
            url: '',
            children: []
        }]
    }]
}

export class MenuItem{
    path: string=''
    icon: string=''
    name: string=''
    module: string=''
    url: string=''
    children: MenuItem[]=[]
}
